package com.ethan.http;

import com.alibaba.dubbo.common.json.JSON;
import com.google.common.collect.Lists;
import lombok.*;

import java.io.IOException;
import java.io.Serializable;
import java.util.List;

/**
 * @author ethan
 * create 2018-05-05 下午9:27
 * desc
 **/
public class HttpTest4 {
    public static void main(String[] args) throws IOException {
        OrderIdListParam orderIdListParam = new OrderIdListParam();
        orderIdListParam.site="xep.trade.qunar.com";
        orderIdListParam.hasExpress=true;
        orderIdListParam.statusList = Lists.newArrayList(12);
        orderIdListParam.startDepartureDate="2018-01-01";
        orderIdListParam.endDepartureDate="2018-06-01";

        //l-noahmfngdtmo1.auto.beta.cn0
        String url ="http://l-noahmfngdtmo1.auto.beta.cn0.qunar.com:8080/justfortest/getOrderIdList";
        String json = JSON.json(orderIdListParam);
        String result =  HttpUtils2.postJson(url, json , HttpUtils2.ClientType.NORMAL);


        String a="";

    }

    @Getter
    @Setter
    @Builder
    @NoArgsConstructor
    @AllArgsConstructor
    public static class OrderIdListParam implements Serializable {
        private static final long serialVersionUID = -1L;

        /**
         * 订单状态id集合
         */
        private List<Integer> statusList;
        /**
         * 是否有行程单
         */
        private boolean hasExpress;
        /**
         * 航班出发起始日期 格式:yyyy-MM-dd
         */
        private String startDepartureDate;
        /**
         * 航班出发终止日期 格式：yyyy-MM-dd
         */
        private String endDepartureDate;
        /**
         * 代理商域名 如：xep.trade.qunar.com
         */
        private String site;
    }
}
